package cn.iocoder.yudao.module.picturebook.dal.mysql.user;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.picturebook.dal.dataobject.user.PBUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.picturebook.controller.admin.user.vo.*;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * 用户信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface PBUserMapper extends BaseMapperX<PBUserDO> {

    default PageResult<PBUserDO> selectPage(PBUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PBUserDO>()
                .likeIfPresent(PBUserDO::getUsername, reqVO.getUsername())
                .eqIfPresent(PBUserDO::getPassword, reqVO.getPassword())
                .likeIfPresent(PBUserDO::getRealName, reqVO.getRealName())
                .eqIfPresent(PBUserDO::getAvatar, reqVO.getAvatar())
                .eqIfPresent(PBUserDO::getGender, reqVO.getGender())
                .betweenIfPresent(PBUserDO::getBirthDate, reqVO.getBirthDate())
                .eqIfPresent(PBUserDO::getPhone, reqVO.getPhone())
                .eqIfPresent(PBUserDO::getEmail, reqVO.getEmail())
                .eqIfPresent(PBUserDO::getUserType, reqVO.getUserType())
                .eqIfPresent(PBUserDO::getSchool, reqVO.getSchool())
                .eqIfPresent(PBUserDO::getGrade, reqVO.getGrade())
                .likeIfPresent(PBUserDO::getClassName, reqVO.getClassName())
                .eqIfPresent(PBUserDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PBUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PBUserDO::getId));
    };

    PBUserDO selectByUsername(String username);

    //根据
}